<template>
    <view>
        <!--标题和返回-->
		<cu-custom :bgColor="NavBarColor" isBack :backRouterName="backRouteName">
			<block slot="backText">返回</block>
			<block slot="content">岩土混合边坡稳定性评价因子权重及赋值</block>
		</cu-custom>
		 <!--表单区域-->
		<view>
			<form>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡高度权重：</text></view>
                  <input type="number" placeholder="请输入切坡高度权重" v-model="model.cutSlopeHeightWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡高度 H≤5m：</text></view>
                  <input type="number" placeholder="请输入切坡高度 H≤5m" v-model="model.cutSlopeHeight1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡高度 5m＜H≤10m：</text></view>
                  <input type="number" placeholder="请输入切坡高度 5m＜H≤10m" v-model="model.cutSlopeHeight2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡高度 10m＜H≤15m：</text></view>
                  <input type="number" placeholder="请输入切坡高度 10m＜H≤15m" v-model="model.cutSlopeHeight3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡高度 H＞15m：</text></view>
                  <input type="number" placeholder="请输入切坡高度 H＞15m" v-model="model.cutSlopeHeight4"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡度权重：</text></view>
                  <input type="number" placeholder="请输入切坡坡度权重" v-model="model.cutSlopeGradientWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡度 a≤45°：</text></view>
                  <input type="number" placeholder="请输入切坡坡度 a≤45°" v-model="model.cutSlopeGradient1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡度 45°＜a≤60°：</text></view>
                  <input type="number" placeholder="请输入切坡坡度 45°＜a≤60°" v-model="model.cutSlopeGradient2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡度 60°＜a≤75°：</text></view>
                  <input type="number" placeholder="请输入切坡坡度 60°＜a≤75°" v-model="model.cutSlopeGradient3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡度 ＞75°：</text></view>
                  <input type="number" placeholder="请输入切坡坡度 ＞75°" v-model="model.cutSlopeGradient4"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡形权重：</text></view>
                  <input type="number" placeholder="请输入切坡坡形权重" v-model="model.cutSlopeShapeWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡形 阶梯型：</text></view>
                  <input type="number" placeholder="请输入切坡坡形 阶梯型" v-model="model.cutSlopeShape1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡形 内凹型：</text></view>
                  <input type="number" placeholder="请输入切坡坡形 内凹型" v-model="model.cutSlopeShape2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡形 直线型：</text></view>
                  <input type="number" placeholder="请输入切坡坡形 直线型" v-model="model.cutSlopeShape3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">切坡坡形 外凸型：</text></view>
                  <input type="number" placeholder="请输入切坡坡形 外凸型" v-model="model.cutSlopeShape4"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">自然斜坡坡度权重：</text></view>
                  <input type="number" placeholder="请输入自然斜坡坡度权重" v-model="model.naturalSlopeGradientWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">自然斜坡坡度 b≤20°：</text></view>
                  <input type="number" placeholder="请输入自然斜坡坡度 b≤20°" v-model="model.naturalSlopeGradient1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">自然斜坡坡度 20°＜b≤30°：</text></view>
                  <input type="number" placeholder="请输入自然斜坡坡度 20°＜b≤30°" v-model="model.naturalSlopeGradient2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">自然斜坡坡度 ＞30°：</text></view>
                  <input type="number" placeholder="请输入自然斜坡坡度 ＞30°" v-model="model.naturalSlopeGradient3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">上覆土层松散程度权重：</text></view>
                  <input type="number" placeholder="请输入上覆土层松散程度权重" v-model="model.upperSoilLoosenessWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">上覆土层松散程度 密实：</text></view>
                  <input type="number" placeholder="请输入上覆土层松散程度 密实" v-model="model.upperSoilLooseness1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">上覆土层松散程度 松散：</text></view>
                  <input type="number" placeholder="请输入上覆土层松散程度 松散" v-model="model.upperSoilLooseness2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">上覆土体类型权重：</text></view>
                  <input type="number" placeholder="请输入上覆土体类型权重" v-model="model.upperSoilTypeWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">上覆土体类型 粘性土：</text></view>
                  <input type="number" placeholder="请输入上覆土体类型 粘性土" v-model="model.upperSoilType1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">上覆土体类型 砂质土：</text></view>
                  <input type="number" placeholder="请输入上覆土体类型 砂质土" v-model="model.upperSoilType2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">上覆土体类型 碎石土：</text></view>
                  <input type="number" placeholder="请输入上覆土体类型 碎石土" v-model="model.upperSoilType3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">下部岩体特征权重：</text></view>
                  <input type="number" placeholder="请输入下部岩体特征权重" v-model="model.underCharacteristicsWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">下部岩体特征 无顺向结构面及软弱夹层：</text></view>
                  <input type="number" placeholder="请输入下部岩体特征 无顺向结构面及软弱夹层" v-model="model.underCharacteristics1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">下部岩体特征 有顺向结构面及软弱夹层：</text></view>
                  <input type="number" placeholder="请输入下部岩体特征 有顺向结构面及软弱夹层" v-model="model.underCharacteristics2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">下部岩体裂隙发育程度权重：</text></view>
                  <input type="number" placeholder="请输入下部岩体裂隙发育程度权重" v-model="model.underRockFractureWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">下部岩体裂隙发育程度 不发育：</text></view>
                  <input type="number" placeholder="请输入下部岩体裂隙发育程度 不发育" v-model="model.underRockFracture1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">下部岩体裂隙发育程度 发育：</text></view>
                  <input type="number" placeholder="请输入下部岩体裂隙发育程度 发育" v-model="model.underRockFracture2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型权重：</text></view>
                  <input type="number" placeholder="请输入岩组类型权重" v-model="model.rockGroupTypeWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 坚硬的块状侵入岩岩组(Y1)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 坚硬的块状侵入岩岩组(Y1)" v-model="model.rockGroupType1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 较坚硬、坚硬的块状火山熔岩，火山碎屑熔岩夹中厚—厚层状火山碎屑岩岩组(Y2)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 较坚硬、坚硬的块状火山熔岩，火山碎屑熔岩夹中厚—厚层状火山碎屑岩岩组(Y2)" v-model="model.rockGroupType2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 较坚硬、坚硬的薄-厚层状板岩、变碎屑岩、千枚岩岩组(B3)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 较坚硬、坚硬的薄-厚层状板岩、变碎屑岩、千枚岩岩组(B3)" v-model="model.rockGroupType3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 较坚硬、坚硬的片状片岩岩组(B2)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 较坚硬、坚硬的片状片岩岩组(B2)" v-model="model.rockGroupType4"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 较坚硬、坚硬的块状变粒岩组(B1)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 较坚硬、坚硬的块状变粒岩组(B1)" v-model="model.rockGroupType5"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 软硬相间的薄—厚层状含煤砂岩、页岩、泥岩岩组(S3)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 软硬相间的薄—厚层状含煤砂岩、页岩、泥岩岩组(S3)" v-model="model.rockGroupType6"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 软弱的、较坚硬的薄—厚层状红层砂岩、砂砾岩、泥岩岩组(S4)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 软弱的、较坚硬的薄—厚层状红层砂岩、砂砾岩、泥岩岩组(S4)" v-model="model.rockGroupType7"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 较坚硬、坚硬的薄—厚层状泥岩、页岩、硅质岩岩组(S1)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 较坚硬、坚硬的薄—厚层状泥岩、页岩、硅质岩岩组(S1)" v-model="model.rockGroupType8"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 较坚硬、坚硬的中厚—厚层状砂岩、砂砾岩、页岩岩组(S2)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 较坚硬、坚硬的中厚—厚层状砂岩、砂砾岩、页岩岩组(S2)" v-model="model.rockGroupType9"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 软弱的、较坚硬的薄层状页岩、砂岩、硅质岩岩组(S5) 赋값：</text></view>
                  <input type="number" placeholder="请输入岩组类型 软弱的、较坚硬的薄层状页岩、砂岩、硅质岩岩组(S5) 赋값" v-model="model.rockGroupType10"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 较坚硬、坚硬的薄—厚层状弱岩溶化杂质灰岩、砂岩、页岩岩组(T3)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 较坚硬、坚硬的薄—厚层状弱岩溶化杂质灰岩、砂岩、页岩岩组(T3)" v-model="model.rockGroupType11"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 较坚硬、坚硬的薄-厚层状中等岩溶化灰岩、白云质灰岩、页岩岩组(T2)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 较坚硬、坚硬的薄-厚层状中等岩溶化灰岩、白云质灰岩、页岩岩组(T2)" v-model="model.rockGroupType12"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">岩组类型 坚硬的中厚-厚层状中等-强岩溶化灰岩、白云岩岩组(T1)：</text></view>
                  <input type="number" placeholder="请输入岩组类型 坚硬的中厚-厚层状中等-强岩溶化灰岩、白云岩岩组(T1)" v-model="model.rockGroupType13"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">植被覆盖率权重：</text></view>
                  <input type="number" placeholder="请输入植被覆盖率权重" v-model="model.vegetationCoverageWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">植被覆盖率 b≤20°：</text></view>
                  <input type="number" placeholder="请输入植被覆盖率 b≤20°" v-model="model.vegetationCoverage1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">植被覆盖率 20°＜b≤80°：</text></view>
                  <input type="number" placeholder="请输入植被覆盖率 20°＜b≤80°" v-model="model.vegetationCoverage2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">植被覆盖率 ＞80°：</text></view>
                  <input type="number" placeholder="请输入植被覆盖率 ＞80°" v-model="model.vegetationCoverage3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">已有治理措施权重：</text></view>
                  <input type="number" placeholder="请输入已有治理措施权重" v-model="model.governanceMeasuresWeight"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">已有治理措施 截排水沟：</text></view>
                  <input type="number" placeholder="请输入已有治理措施 截排水沟" v-model="model.governanceMeasures1"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">已有治理措施 护脚墙：</text></view>
                  <input type="number" placeholder="请输入已有治理措施 护脚墙" v-model="model.governanceMeasures2"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">已有治理措施 挡土墙：</text></view>
                  <input type="number" placeholder="请输入已有治理措施 挡土墙" v-model="model.governanceMeasures3"/>
                </view>
              </view>
              <view class="cu-form-group">
                <view class="flex align-center">
                  <view class="title"><text space="ensp">已有治理措施 综合治理：</text></view>
                  <input type="number" placeholder="请输入已有治理措施 综合治理" v-model="model.governanceMeasures4"/>
                </view>
              </view>
				<view class="padding">
					<button class="cu-btn block bg-blue margin-tb-sm lg" @click="onSubmit">
						<text v-if="loading" class="cuIcon-loading2 cuIconfont-spin"></text>提交
					</button>
				</view>
			</form>
		</view>
    </view>
</template>

<script>
    import myDate from '@/components/my-componets/my-date.vue'

    export default {
        name: "SoilRockSlopeSettingForm",
        components:{ myDate },
        props:{
          formData:{
              type:Object,
              default:()=>{},
              required:false
          }
        },
        data(){
            return {
				CustomBar: this.CustomBar,
				NavBarColor: this.NavBarColor,
				loading:false,
                model: {},
                backRouteName:'index',
                url: {
                  queryById: "/soilrockslopesetting/soilRockSlopeSetting/queryById",
                  add: "/soilrockslopesetting/soilRockSlopeSetting/add",
                  edit: "/soilrockslopesetting/soilRockSlopeSetting/edit",
                },
            }
        },
        created(){
             this.initFormData();
        },
        methods:{
           initFormData(){
               if(this.formData){
                    let dataId = this.formData.dataId;
                    this.$http.get(this.url.queryById,{params:{id:dataId}}).then((res)=>{
                        if(res.data.success){
                            console.log("表单数据",res);
                            this.model = res.data.result;
                        }
                    })
                }
            },
            onSubmit() {
                let myForm = {...this.model};
                this.loading = true;
                let url = myForm.id?this.url.edit:this.url.add;
				this.$http.post(url,myForm).then(res=>{
				   console.log("res",res)
				   this.loading = false
				   this.$Router.push({name:this.backRouteName})
				}).catch(()=>{
					this.loading = false
				});
            }
        }
    }
</script>
